home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swaga_c.zip / ARCHIVES.SWG / 0023_ARJ Password Cracker.pas < prev    next >
Pascal/Delphi Source File  |  1995-03-03  |  4KB  |  191 lines

  1. {
  2. > Do somebody have a ARJ 2.41 Password finder, because I have packed
  3. > some of my pascal codes and grabled it with password and now .... hmmmm
  4. > I can't extract the ARJ file with the password.  I must have typed a
  5. > different password when I pascked those files.
  6.  
  7. In my next two messages is ARJCRACK.PAS.  It's a program that may
  8. help you find that password.  It's EXTREMELY slow, but if you are
  9. really really really (did i say really? :)) ) desperate about it
  10. you might want to give it a try.
  11.  
  12. You will need to place this in a FAST machine (one you won't need
  13. for a LONG while) along with ARJ.EXE and the password-encrypted
  14. archive on the same drive & directory.
  15.  
  16. Tips to speed it up:
  17.  
  18.  + Using "ARJ v archive," pick the smallest file you can find (but not
  19.    less than about 10 bytes), that was archived using the store method
  20.    (no compression)
  21.  + Move ARJ.EXE, ARJCRACK.EXE and the archive in a ram drive.
  22.  + Remove some characters in PassSet that you think you never used
  23.    as the password (maybe  ~ ` ^ etc..)
  24.  + Run it in plain old DOS *NOT* under Windows or DESQview or OS2.
  25.  + Start off the [last_password] parameter with "a" x minimum-password-
  26.    length-that-you-normaly-use.  Something like:
  27.  
  28.    arjcrack sources small.pas aaaa
  29.                               ^^^^
  30.              if you're sure that you never use passwords that are less
  31.              than 4 characters
  32.  
  33. jon.zarate@vidgame.com
  34. }
  35.  
  36. {$M 8192, 0, 0}
  37. {$V-}{$S-}{$G+}{$X+}{$R-}
  38.  
  39. uses
  40.  Crt, Dos;
  41.  
  42.  
  43. const
  44.  PassSet : String =
  45.    'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' +
  46.    '0123456789`=\[];'',./~!@#$%^&*()_{}:';
  47.  
  48. var
  49.  Pw  : String;
  50.  Arc : String;
  51.  Fn  : String;
  52.  Prev: String;
  53.  
  54. procedure Sounder(R : Integer);
  55. var
  56.  N : Integer;
  57.  
  58. begin
  59.  N:=2000;
  60.  repeat
  61.   Sound(N);
  62.   N:=N + R;
  63.   if (N < 50) then N:=2000 else
  64.   if (N > 2000) then N:=50;
  65.   Delay(2);
  66.  until (KeyPressed);
  67.  NoSound;
  68. end;
  69.  
  70. procedure Crack;
  71. var
  72.  I : Word;
  73.  Pw: String[40];
  74.  J : Word;
  75.  X : Word;
  76.  Y : Word;
  77.  Z : array[1..41] of Byte;
  78.  C : Word;
  79.  
  80. begin
  81.  FillChar(Z, SizeOf(Z), 0);
  82.  
  83.  if (Prev <> '') then
  84.   begin
  85.    for I:=1 to Length(Prev) do
  86.     begin
  87.      Z[I]:=Pos(Prev[I], PassSet);
  88.      if (Z[I] = 0) then
  89.       begin
  90.        writeln('Invalid character in [last_password]');
  91.        Halt;
  92.       end;
  93.     end;
  94.  
  95.    Pw:=Prev;
  96.    X:=Length(Pw);
  97.    J:=X;
  98.   end else
  99.   begin
  100.    Pw:=PassSet[1];
  101.    Z[1]:=1;
  102.    X:=1;
  103.    J:=1;
  104.   end;
  105.  
  106.  
  107.  repeat
  108.   Pw[1]:=PassSet[Z[1]];
  109.  
  110.   writeln;
  111.   writeln;
  112.   writeln('////////////////////////////////////////////////////////////');
  113.   writeln('ARJ t ', Arc, ' ', Fn, ' -g', Pw);
  114.   writeln;
  115.   SwapVectors;
  116.   Exec('ARJ.EXE', 't ' + Arc + ' ' + Fn + ' -g' + Pw);
  117.   SwapVectors;
  118.   writeln('////////////////////////////////////////////////////////////');
  119.  
  120.   C:=DosExitCode;
  121.  
  122.   if ((C = 0) and (DosError = 0)) then
  123.    begin
  124.     writeln;
  125.     writeln;
  126.     writeln('Hey I found it!!');
  127.     writeln('The password is -- ', Pw);
  128.     writeln;
  129.     Sounder(10);
  130.     Halt
  131.    end;
  132.  
  133.   if ((C <> 3) or (DosError <> 0)) then
  134.    begin
  135.     writeln;
  136.     writeln('Duhh... What happened?? Why did I get an EXITCODE of ',
  137.       C, ' and a DOSERROR of ', DosError, '??');
  138.     Sounder(-30);
  139.     Halt
  140.    end;
  141.  
  142.   if (KeyPressed) then
  143.    begin
  144.     writeln('ARJCRACK aborted.');
  145.     writeln('Last password used was --> ', Pw, ' <--');
  146.     Halt;
  147.    end;
  148.  
  149.   inc(Z[1]);
  150.   for I:=1 to X do
  151.    begin
  152.     if (Z[I] > Length(PassSet)) then
  153.      begin
  154.       Z[I]:=1;
  155.       inc(Z[I + 1]);
  156.       if (I = J) then
  157.        begin
  158.         inc(J);
  159.         inc(X);
  160.         Pw[0]:=Chr(X);
  161.         Pw[X]:=PassSet[1];
  162.        end;
  163.      end;
  164.      Pw[I]:=PassSet[Z[I]];
  165.     end;
  166.  until (X > Length(Pw));
  167.  
  168.  writeln('Sorry, I can''t find the password!!');
  169.  Sounder(-2);
  170. end;
  171.  
  172. begin
  173.  writeln;
  174.  writeln;
  175.  writeln('ARJ Password Cracker Version 0.10');
  176.  writeln('by Jonathan Zarate');
  177.  writeln;
  178.  writeln('Password character set: ', PassSet);
  179.  writeln;
  180.  if ((ParamCount < 2) or (ParamCount > 3)) then
  181.   begin
  182.    writeln('Usage: ARJCRACK <archive> <file_to_crack> [last_password]');
  183.    Halt;
  184.   end;
  185.  
  186.  Arc:=ParamStr(1);
  187.  Fn:=ParamStr(2);
  188.  Prev:=ParamStr(3);
  189.  Crack;
  190. end.
  191.